using HighlightingSystem;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class 循环水泵 : DeviceMono
{
    //public Transform highlighters_DeviceItem;//循环泵

    //new void Start() 
    //{
    //    Debug.Log("高亮："+deviceHighlighter.tweenGradient.colorKeys.Length);
    //    for (int i = 0; i < deviceHighlighter.tweenGradient.colorKeys.Length; i++)
    //    {
    //        Debug.Log("高亮：" + deviceHighlighter.tweenGradient.colorKeys[i].color);
    //    }
        
    //    //deviceHighlighter.tweenGradient = new Gradient();
    //}

    internal override void DeviceMontoring(string[] dataStrArray) 
    {
        if (movement_List.Contains(dataStrArray[0]))
        {
            Debug.Log("设备状态："+dataStrArray[0]+ dataStrArray[1]+"--"+ movement_List[0] == dataStrArray[0] && dataStrArray[1] == "True");
            if (movement_List[0] == dataStrArray[0] && dataStrArray[1] == "True")
            {
                deviceRun_or_not = true;
                DeviceAlarm.instance.SetStartHighter_Normal(deviceHighlighter);
            }
            else if(movement_List[0] == dataStrArray[0] && dataStrArray[1] == "False")
            {
                deviceRun_or_not = false;
                deviceHighlighter.tween = false;
            }
        }
    }

    //private void Update()
    //{
    //    if (Input.GetKey(KeyCode.G))
    //    {
    //        Debug.Log("aa");
    //        //deviceHighlighter.tweenGradient.colorKeys[0].color = Color.green;
    //        //deviceHighlighter.tweenGradient.colorKeys[1].color = Color.green;
    //        //GradientColorKey[] gradient = new GradientColorKey[]
    //        //{
    //        //    new GradientColorKey{ color = Color.green,
    //        //    time = 0.5f },
    //        //     new GradientColorKey{ color = Color.green,
    //        //    time = 0.5f }
    //        //};
    //        //deviceHighlighter.tweenGradient.SetKeys(gradient, null);

    //        deviceHighlighter.FlashingOn(new Color(0f/255f, 144f/255f, 54/255f),
    //            new Color(0 / 255f, 144 / 255f, 54 / 255f), 
    //            deviceHighlighter.tweenGradient.alphaKeys,0.5f);
    //    }
    //    else if (Input.GetKey(KeyCode.R))
    //    {
    //        //Debug.Log("aa");
    //        //deviceHighlighter.tweenGradient.colorKeys[0].color = Color.red;
    //        //deviceHighlighter.tweenGradient.colorKeys[1].color = Color.red;


    //        //deviceHighlighter.color = Color.red;
    //        deviceHighlighter.FlashingOn(Color.red,Color.red);
    //    }
    //}
}
